package com.ruoyi.find.controller;


import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.find.service.LoginDriverService;
import com.ruoyi.find.vo.LoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @description: TODO
 * @author LiuWei Chen
 * @date 2025/8/27 14:48
 * @version 1.0
 */

@RestController
@RequestMapping("/driverClient")
public class DriverClientController {
    @Autowired
    LoginDriverService driverService;

    /**
     * @author LiuWeiChen
     * @description pageList
     * @params []
     * @return com.ruoyi.common.core.web.domain.AjaxResult
     * @date 2025/8/29 16:51
    */


    /**
     * @author LiuWeiChen
     * @description sendCode
     * @params [mobile]
     * @return com.ruoyi.common.core.web.domain.AjaxResult
     * @date 2025/8/29 16:52
    */

    @PostMapping("/sendCodes")
    public AjaxResult sendCode(@RequestParam("phone") String phone) {
        return driverService.sendCode(phone);
    }



    /**
     * @author LiuWeiChen
     * @description login
     * @params [loginDriver]
     * @return com.ruoyi.common.core.web.domain.AjaxResult
     * @date 2025/8/29 16:52
    */
    @PostMapping("/phoneLogin")
    public AjaxResult phoneLogin(@RequestBody LoginVo loginVo ) {
        return driverService.phoneLogin(loginVo);
    }
    @GetMapping("/getDriverInfo")
    public AjaxResult getDriverInfo(@RequestHeader("token") String token) {
        return driverService.getDriverInfo(token);
    }
}
















